<?php
if(!isset($_SESSION)) 
{ 
session_start(); 
}  
include '../../operations/connection.php';

$idcomp = $_REQUEST['idcomp'];
$newlang = $_REQUEST['newlang'];

if ($_REQUEST['newlang'] == "EN") {
	include "../../value/value_en.php";
} else if($_REQUEST['newlang'] == "VN") {
	include "../../value/value_vn.php";
}
else {
	include "../../value/value_kr.php";
}

$selectpartnerbyID = mysql_query("SELECT am.PartnerID,am.PartnerName,am.DatabaseName,am.KeyName,am.DomainName,am.Phone,am.Email,am.Website,am.`Status`,am.RootHome 
		 FROM `ac_eli_manager` am WHERE am.Role=2 and am.`Status` !=3 AND am.PartnerID = '$idcomp'");
$result = mysql_fetch_assoc($selectpartnerbyID);
?>

<form action="admin/partnermanage/process-add-partner-manage.php"
	onsubmit="return checkEmptyUpdate();" method="post">
	<input type="hidden" value="<?=$result[PartnerID]?>" name="idpartnercomp">
<table align="center">
	<tbody>
		<tr style="height: 21px;">
			<td style="width: 30%"><?php echo $l_doitac?>: <span style="color: red">( * )</span></td>
			<td style="width: 70%"><input onkeypress="return enterTable1(event,this.id);" id="parnername" name="parnername" type="text"
				value="<?php echo $result[PartnerName]?>"
				style="height: 21px;width: 100%;border: 1px solid #c4c6c9;" /></td>
		</tr>
		<tr style="height: 21px;">
			<td><?php echo $l_passwordLBL?> <span style="color: red">( * )</span></td>
			<td><input type="password" id="password" name="password" readonly="readonly"
				style="height: 21px;background: #eee;width: 100%;border: 1px solid #c4c6c9;" value="" /></td>
		</tr>
		<tr style="height: 21px;">
			<td><?php echo $l_retypepassword?> : <span style="color: red">( * )</span></td>
			<td><input type="password" id="repassword" name="repassword" readonly="readonly"
				style="height: 21px;background: #eee;width: 100%;border: 1px solid #c4c6c9;" value=""></td>
		</tr>
		<tr style="height: 21px;">
			<td><?php echo $l_databasename?> : <span style="color: red">( * )</span></td>
			<td><input id="databasename" name="databasename" type="text"
				value="<?php echo $result[DatabaseName]?>" readonly="readonly"
				style="height: 21px;width: 100%;background: #eee;border: 1px solid #c4c6c9;" /></td>
		</tr>
		<tr style="height: 21px;">
			<td><?php echo "Domain name "?> : <span style="color: red">( * )</span></td>
			<td>
				<?php if ($result[KeyName]=="erp"){?>
					<input id="databasename" name="databasename" type="text"
						value="<?php echo $result[DomainName]?>" readonly="readonly"
						style="height: 21px;width: 100%;background: #eee;border: 1px solid #c4c6c9;" readonly="readonly" />
				<?php }else{?>
				<input id="domainname" name="domainname" type="text"  value="<?php echo $result[KeyName]?>" 
					 style="height: 21px;width: 29%;background: #eee;" readonly="readonly" />
				<input value="." style="width: 1%;border: none;font-weight: bold;
					 text-align: center;" readonly="readonly">
				<input id="enddatabasename" name="enddatabasename"  type="text" value="myapprove.com" 
					style="height: 21px;width: 68%;background: #eee;float: right;border: 1px solid #c4c6c9;" readonly="readonly"/>
					<?php }?>
				</td>
		</tr>
		<tr style="height: 21px;">
			<td><?php echo $l_email?> : <span style="color: red">( * )</span></td>
			<td><input onkeypress="return enterTable1(event,this.id);" id="email" name="email" type="text"
				value="<?php echo $result[Email]?>" style="height: 21px;width: 100%;border: 1px solid #c4c6c9;" />
			</td>
		</tr>
		<tr style="height: 21px;">
			<td><?php echo $l_phone?> :</td>
			<td><input onkeypress="return enterTable1(event,this.id);" id="phone" name="phone" type="text"
				value="<?php echo $result[Phone]?>" style="height: 21px;width: 100%;border: 1px solid #c4c6c9;" />
			</td>
			<td></td>
		</tr>
		<tr style="height: 21px;">
			<td><?php echo $l_Website?> :</td>
			<td><input onkeypress="return enterTable1(event,this.id);" id="website" name="website" type="text"
				value="<?php echo $result[Website]?>" style="height: 21px;width: 100%;border: 1px solid #c4c6c9;" /></td>
			<td></td>
		</tr>
		<tr style="height: 21px;">
		<td><?php echo $l_status?> :</td>
			<td><select id="status" name="status" size="1" style="width: 100%;height: 22px;">
				<option value="1" <?php if ($result[Status]==1){?> selected="selected" <?php }?>><?php echo $l_ngunghoatdong;?></option>
				<option value="2" <?php if ($result[Status]==2){?> selected="selected" <?php }?>><?php echo $l_danghoatdong;?></option>
				</select></td>
			<td></td>
		</tr>
		<tr style="height: 21px;">
			<td><?php echo $l_roothome?> :</td>
			<td><input  onkeypress="return enterTable(event,this.id);" id="roothome" name="roothome" type="text" 
				value="<?php echo $result[RootHome]?>" style="height: 21px;width: 100%;border: 1px solid #c4c6c9;" /></td>
			<td></td>
		</tr>
	</tbody>
</table>

<br />
<div style="text-align: center;">
	<input name="update" id="update" value="<?php echo $l_update?>" class="buttonNormal" type="submit" /> 
	<input name="delete" id="delete" value="<?php echo $l_delete?>" class="buttonNormal" type="button"
	 onclick="if(confirm('<?php echo $l_confirm_deleteproject?>')){ deletecomp('<?=$result[PartnerID]?>',this); return true;}else{return false;}"/> 
	<input name="register" id="register" value="<?php echo $l_register?>" class="buttonNormalDisable" type="button" /> 
	<input name="reset" value="<?php echo $l_reset?>"
		class="buttonNormal" type="reset" onclick="resetchildPartner();" /> <br />
</div>
</form>
